(list-colors-display): Don't use `display-color-cells' unless the
authorMiles Bader <miles@gnu.org>
Thu, 9 May 2002 18:04:27 +0000 (18:04 +0000)
committerMiles Bader <miles@gnu.org>
Thu, 9 May 2002 18:04:27 +0000 (18:04 +0000)
display class is one for which that info is relevant.

lisp/facemenu.el

index 96c73e77bbda39d2ca79afe2b0a804f2d1d3460f..c7e9cdd3a53710c13180ee1c1d61e83304fd9e6e 100644 (file)
@@ -487,10 +487,11 @@ of colors that the current display can handle."
        (if (facemenu-color-equal (car l) (car (cdr l)))
            (setcdr l (cdr (cdr l)))
          (setq l (cdr l)))))
-    ;; Don't show more than what the display can handle.
-    (let ((lc (nthcdr (1- (display-color-cells)) list)))
-      (if lc
-         (setcdr lc nil))))
+    (when (memq (display-visual-class) '(gray-scale pseudo-color direct-color))
+      ;; Don't show more than what the display can handle.
+      (let ((lc (nthcdr (1- (display-color-cells)) list)))
+       (if lc
+           (setcdr lc nil)))))
   (with-output-to-temp-buffer "*Colors*"
     (save-excursion
       (set-buffer standard-output)